package com.ssy.lingxi.product.api.feign;

import com.ssy.lingxi.common.model.vo.SelectVO;
import com.ssy.lingxi.common.response.Wrapper;
import com.ssy.lingxi.product.api.hystrix.SelectProductHystrix;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;

/**
 * @menu: 下拉框管理
 * 下拉框管理
 * @author jw.chen
 * @version 2.0.0
 * @date 2020/6/30
 */
@FeignClient(value = "product-service", fallback = SelectProductHystrix.class)
public interface ISelectProductFeign {

    /**
     * 查询会员品类下拉框
     * @param name 品类名称
     * @return
     */
    @RequestMapping(value = "/product/select/getSelectCustomerCategory", method = RequestMethod.GET)
    Wrapper<List<SelectVO>> getSelectCustomerCategory(@RequestParam("name") String name);

    /**
     * 查询会员品类最大级别
     * @return
     */
    @RequestMapping(value = "/product/select/getMaxCustomerCategory", method = RequestMethod.GET)
    Wrapper<Integer> getMaxCustomerCategory();

    /**
     * 根据父级id查询会员品类
     * @return
     */
    @RequestMapping(value = "/product/select/getCustomerCategoryByParentId", method = RequestMethod.GET)
    Wrapper<List<SelectVO>> getCustomerCategoryByParentId(Long parentId);

    /**
     * 根据父级id查询平台后台品类
     * @return
     */
    @RequestMapping(value = "/product/select/getCategoryByParentId", method = RequestMethod.GET)
    Wrapper<List<SelectVO>> getCategoryByParentId(@RequestParam("parentId") Long parentId);

}
